﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace WebApplication1
{
    /// <summary>
    /// WebService1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public void AppentStr2Txt(string text)
        {
            //System.IO.File.AppendAllText(Server.MapPath("~/q4.txt"), text);
            using (StreamWriter sw = File.AppendText(Server.MapPath("~/q4.txt")))
            {
                sw.WriteLine(text);
                sw.Flush();
            }
        }
    }
}
